package pers.brozen.anka.controller;

import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.brozen.anka.apis.params.WechatMiniProgramLoginParam;
import pers.brozen.anka.dao.entity.AnkaSession;
import pers.brozen.anka.service.WechatAuthService;
import pers.brozen.anka.support.web.response.Response;

/**
 * @author Brozen
 * @since 2024-05-28
 */
@RestController
@RequestMapping("/api/wechat/mini-program/auth")
public class WechatAuthController {

    @Resource
    private WechatAuthService weChatAuthService;



    @PostMapping("/login")
    public Response<AnkaSession> login(@Valid @RequestBody WechatMiniProgramLoginParam param) {
        return Response.ofSuccess(weChatAuthService.login(param));
    }





}
